import QtQuick 2.6
import QtQuick.Layouts 1.3
import Qt.labs.controls 1.0
import Qt.labs.settings 1.0
import QtQml.Models 2.2
import "../template" as Tm
import "../js/index.qml.js" as  Jit

Tm.WinRoot {
    title: item.title

    ObjectModel {
        id: m1
        ToolButton {
            text: "登录/注册"
            width: parent ? parent.width: 0

            onClicked: contentArea.navigate("../qml/LoginNavigator.qml")
        }
        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }

        Label {
            text: "管理"

            height: 40
            color: "darkolivegreen"
            verticalAlignment: Text.AlignVCenter
        }
        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }

        ToolButton {
            text: "约车记录"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate("../qml/AttendCarTNavigator.qml")
        }
        ToolButton {
            text: "课程设置"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate(Qt.resolvedUrl("../qml/CourseNavigator.qml"))
        }

        ToolButton {
            text: "场地设置"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate(Qt.resolvedUrl("../qml/PlaceNavigator.qml"))
        }
        ToolButton {
            text: "学员管理"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate(Qt.resolvedUrl("../qml/MemberManagerNavigator.qml"))
        }
        ToolButton {
            text: "测试内容"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate(Qt.resolvedUrl("../qml/TestManagerNavigator.qml"))
        }
        ToolButton {
            text: "考试记录"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate(Qt.resolvedUrl("../qml/ExamProgressManageNavigator.qml"))
        }
        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }
        Label {
            text: "设置"

            color: "darkolivegreen"
            height: 40
            verticalAlignment: Text.AlignVCenter
        }
        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }

        ToolButton {

            text: "个人资料"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate("../qml/MyInfoNavigator.qml")
        }


        ToolButton {
            id: overlay
            text: "安全"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate("../qml/SecuritySettingNavigator.qml")
        }


        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }
    }

    ObjectModel {
        id: m2
        ToolButton {
            text: "登录/注册"
            width: parent ? parent.width: 0

            onClicked:  contentArea.navigate("../qml/LoginNavigator.qml")
        }
        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }

        Label {
            text: "培训"
            x: 9

            height: 40

            color: "darkolivegreen"
            font.pixelSize: 14
            font.letterSpacing: 9
            verticalAlignment: Text.AlignVCenter
        }
        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }

        ToolButton {
            text: "签到"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate("../qml/RecordSignPage.qml")
        }



        ToolButton {
            text: "约车"
            width: parent ? parent.width: 0
            //height: iHEIGHT * 0.9
            onClicked: Jit.navigate("../qml/AttendCarNavigator.qml")
        }

        ToolButton {
            text: "考试进度"
            width: parent ? parent.width: 0
            //height: iHEIGHT * 0.9
            onClicked: Jit.navigate("../qml/ExamProgressNavigator.qml")
        }

        ToolButton {
            text: "我的测试"
            width: parent ? parent.width: 0
            //height: iHEIGHT * 0.9
            onClicked: Jit.navigate("../qml/MyTestHistoryNavigator.qml")
        }
        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }


        Label {
            text: "设置"
            x: 9

            height: 40
            font.pixelSize: 13

            color: "darkolivegreen"
            verticalAlignment: Text.AlignVCenter
        }
        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }
        ToolButton {
            text: "个人资料"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate("../qml/MyInfoNavigator.qml")
        }



        ToolButton {
            text: "安全"
            width: parent ? parent.width: 0

            onClicked: Jit.navigate("../qml/SecuritySettingNavigator.qml")
        }

        Rectangle { width: parent ? parent.width: 0; height: 1; color: "gainsboro" }
    }


    actionMenu.onClicked:  Jit.menuClicked()
    property alias objectModelM1: m1
    model: m2

    initialItem: MainPageNavigator{id: item}

    onQuitApp: Qt.quit()
    onHomeClicked: contentArea.navigate(Qt.resolvedUrl("../qml/MainPageNavigator.qml"))
}
